package com.practice.J2E.Test;

import java.util.Date;
import java.util.List;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.TimeInterval;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.collection.CollUtil;

/**
 * @author kayn
 * @create 2023-09-07 上午 11:45
 */
public class HutoolTest {



    public static void main(String[] args) throws Exception{

        System.out.println(DateUtil.format(new Date(), DatePattern.CHINESE_DATE_PATTERN + StrUtil.SPACE + DatePattern.NORM_TIME_PATTERN));

//        testCollection();

//        testTimer();

        String str = "  OMS1 OMS2    OMS3";

        System.out.println(StrUtil.split(str,StrUtil.SPACE,true,true));

    }

    private static void testTimer() throws Exception{

        TimeInterval timer = DateUtil.timer();

        Thread.sleep(1000);

        System.out.println(timer.intervalSecond());

        Thread.sleep(1000);

        System.out.println(timer.intervalSecond());


    }

    private static void testCollection() {
        List<String> numList = CollUtil.newArrayList("1", "2", "3");

        String numString = StrUtil.join(StrUtil.COMMA, numList);

        System.out.println(numString);
    }

}